import { createWebHashHistory, createRouter } from 'vue-router'

import Layout from '@/layout/Layout.vue'

export const routes = [
 // 根路径重定向
 {
  path: '/',
  redirect: '/hospital',
 },
 // 登录页
 {
  path: '/login',
  component: () => import('@/pages/Login/Login.vue'),
 },
 // 首页医院综合管理
 {
  path: '/hospital',
  redirect: '/hospital/DepartmentManage',
  meta: { title: '医院综合', icon: 'Document' },
  component: Layout,
  children: [
   {
    path: '/hospital/departmentManage',
    meta: { title: '科室管理' },
    component: () => import('@/pages/Home/DepartmentManage.vue'),
   },
   {
    path: '/hospital/addDepartment',
    meta: { title: '添加科室' },
    component: () => import('@/pages/Home/AddDepartment.vue'),
   },
  ],
 },
 // 患者大数据
 {
  path: '/patientData',
  redirect: '/patientData/diseaseData',
  meta: { title: '患者大数据', icon: 'IconMenu' },
  component: Layout,
  children: [
   {
    path: '/patientData/diseaseData',
    meta: { title: '疾病大数据' },
    component: () => import('@/pages/PatientData/DiseaseData.vue'),
   },
   {
    path: '/patientData/drugconsumption',
    meta: { title: '药品耗材统计' },
    component: () => import('@/pages/PatientData/DrugConsumption.vue'),
   },
  ],
 },
 // 动态个人
 {
  path: '/personal',
  redirect: '/personal/registManage',
  meta: { title: '动态个人', icon: 'Location' },
  component: Layout,
  children: [
   {
    path: '/personal/registManage',
    meta: { title: '挂号管理' },
    component: () => import('@/pages/Personal/RegistManage.vue'),
   },
  ],
 },
 // 中西医药房
 {
  path: '/pharmacy',
  redirect: '/pharmacy/revenueData',
  meta: { title: '中西医药房', icon: 'Setting' },
  component: Layout,
  children: [
   {
    path: '/pharmacy/revenueData',
    meta: { title: '营收数据表' },
    component: () => import('@/pages/Pharmacy/RevenueData.vue'),
   },
   {
    path: '/pharmacy/prescriptionManage',
    meta: { title: '处方综合管理' },
    component: () => import('@/pages/Pharmacy/PrescriptionManage.vue'),
   },
  ],
 },
 // 医疗前线
 {
  path: '/medicalfrontline',
  redirect: '/medicalfrontline/prescriptionIssuance',
  meta: { title: '医疗前线', icon: 'Location' },
  component: Layout,
  children: [
   {
    path: '/medicalfrontline/prescriptionIssuance',
    meta: { title: '处方开具' },
    component: () =>
     import('@/pages/MedicalFrontline/PrescriptionIssuance.vue'),
   },
   {
    path: '/medicalfrontline/prescriptionManage',
    meta: { title: '处方综合管理' },
    component: () => import('@/pages/MedicalFrontline/PrescriptionManage.vue'),
   },
  ],
 },
 // 医疗药品出入库
 {
  path: '/drugOutbound',
  redirect: '/drugOutbound/addMedical',
  meta: { title: '医疗药品出入库', icon: 'IconMenu' },
  component: Layout,
  children: [
   {
    path: '/drugOutbound/addMedical',
    meta: { title: '医疗用品综合管理' },
    component: () => import('@/pages/DrugOutbound/AddMedical.vue'),
   },
   {
    path: '/drugOutbound/drugManage',
    meta: { title: '添加药品耗材' },
    component: () => import('@/pages/DrugOutbound/DrugManage.vue'),
   },
  ],
 },
 // 分级护士
 {
  path: '/gradedNurse',
  redirect: '/gradedNurse/nurseList',
  meta: { title: '分级护士', icon: 'Location' },
  component: Layout,
  children: [
   {
    path: '/gradedNurse/nurseList',
    meta: { title: '综合列表' },
    component: () => import('@/pages/GradedNurse/NurseList.vue'),
   },
   {
    path: '/gradedNurse/workforce',
    meta: { title: '排班管理' },
    component: () => import('@/pages/GradedNurse/Workforce.vue'),
   },
   {
    path: '/gradedNurse/personMsg',
    meta: { title: '修改个人信息' },
    component: () => import('@/pages/GradedNurse/PersonMsg.vue'),
   },
  ],
 },
 // 分级医生
 {
  path: '/gradedDoctor',
  redirect: '/gradedDoctor/doctorList',
  meta: { title: '分级医生', icon: 'Location' },
  component: Layout,
  children: [
   {
    path: '/gradedDoctor/doctorList',
    meta: { title: '综合列表' },
    component: () => import('@/pages/gradedDoctor/DoctorList.vue'),
   },
   {
    path: '/gradedDoctor/workforce',
    meta: { title: '排班管理' },
    component: () => import('@/pages/gradedDoctor/Workforce.vue'),
   },
   {
    path: '/gradedDoctor/personMsg',
    meta: { title: '修改个人信息' },
    component: () => import('@/pages/gradedDoctor/PersonMsg.vue'),
   },
  ],
 },
 // 病床管理
 {
  path: '/hospitalBed',
  redirect: '/hospitalBed/addBed',
  meta: { title: '病床管理', icon: 'Setting' },
  component: Layout,
  children: [
   {
    path: '/hospitalBed/addBed',
    meta: { title: '添加床位' },
    component: () => import('@/pages/HospitalBed/AddBed.vue'),
   },
   {
    path: '/hospitalBed/bedManage',
    meta: { title: '综合管理' },
    component: () => import('@/pages/HospitalBed/BedManage.vue'),
   },
  ],
 },
 // 账号管理
 {
  path: '/account',
  redirect: '/account/accountList',
  meta: { title: '账号管理', icon: 'Location' },
  component: Layout,
  children: [
   {
    path: '/account/accountList',
    meta: { title: '账号管理' },
    component: () => import('@/pages/Account/AccountList.vue'),
   },
   {
    path: '/account/accountManage',
    meta: { title: '添加科室' },
    component: () => import('@/pages/Account/AccountManage.vue'),
   },
  ],
 },
]
const router = createRouter({
 history: createWebHashHistory(),
 routes,
})
export default router
